function query_express_detail(button){
    $(button).attr('disabled',"true");
    $parent_div = $('#express-delivery-detail');
    $parent_div.html('<img src="/web/static/src/img/throbber.gif" width="16" height="16"/>');
    var shipping_type = $parent_div.attr('data-shipping-type');
    var shipping_code = $parent_div.attr('data-shipping-code');
    $parent_div.load('/card/exchange/express-delivery-detail?shipping_type='
        + shipping_type + '&shipping_code=' + shipping_code, {}, function(){
        //$(button).removeAttr("disabled");
    });
}


openerp.dzx_ext = function(instance) {
    var QWeb = instance.web.qweb,
        _t = instance.web._t;

    instance.web.dzx_ext = instance.web.dzx_ext || {};


    $(function(){
        instance.web.views.add('graph_view_card_status_report', 'instance.web.dzx_ext.graph_view_card_status_report');
        instance.web.dzx_ext.graph_view_card_status_report = instance.web_graph.GraphView.extend({
            init: function() {
                var self = this;
                this._super.apply(this, arguments);
                this.on('list_view_loaded', this, function() {

                });
                //统计图表上方添加按钮
                if(self.__parentedParent.$el.find('.oe_product_card_status_report').length == 0){
                    // var button3 = $("<button type='button' class='oe_button oe_product_card_status_report'>刷新2017卡券状态统计</button>").click(this.proxy('product_card_status_report_2017_action'));
                    // self.__parentedParent.$el.find('.oe_view_manager_buttons').append(button3);
                    var button4 = $("<button type='button' class='oe_button oe_product_card_status_report'>刷新2018卡券状态统计</button>").click(this.proxy('product_card_status_report_2018_action'));
                    self.__parentedParent.$el.find('.oe_view_manager_buttons').append(button4);
                }
            },
            product_card_status_report_2017_action: function(){
                var self = this;
                this.model.call('refresh_statistics_2017', []).then(function(){
                    self.search_view.do_search();
                })
            },
            product_card_status_report_2018_action: function(){
                var self = this;
                this.model.call('refresh_statistics_2018', []).then(function(){
                    self.search_view.do_search();
                })
            }
        });
    })
}
